//
//  UIButton+Extension.swift
//  sinaweibo
//
//  Created by mac book pro on 16/3/26.
//  Copyright © 2016年 finish. All rights reserved.
//

import UIKit
extension UIButton{
    convenience init(title: String,imageName: String,bkgImageName: String = "timeline_card_bottom_background",textColor: UIColor = UIColor.lightGrayColor(),textFont: CGFloat = CZStatusCellBottomDefaultFontSize){
        self.init()
        //设置
        self.setBackgroundImage(UIImage(named: bkgImageName), forState: UIControlState.Normal)
        self.setBackgroundImage(UIImage(named: "\(bkgImageName)_highlighted"), forState: UIControlState.Highlighted)
        
        self.setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        self.setTitle(title, forState: UIControlState.Normal)
        self.setTitleColor(textColor, forState: UIControlState.Normal)
        self.titleLabel?.font = UIFont.systemFontOfSize(textFont)
    }
}
